/**
 * 
 */
package it.fuesi.signit.adapters;

import it.fuesi.signit.CurrentSettings;
import it.fuesi.signit.model.Signature;

import java.util.List;

import android.content.Context;
import android.widget.ArrayAdapter;

/**
 * @author pascotto
 *
 */
public class CopyOfSignaturesAdapter extends ArrayAdapter<Signature> {

	public CopyOfSignaturesAdapter(Context context, int resource) {
		super(context, resource);
	}
	
	
	public void fetch(){
		clear();
		final List<Signature> signatures = CurrentSettings.instance().getSignatures();
		if(signatures != null){
			for(Signature s : signatures)
				add(s);
		}
		
		if(signatures == null || signatures.size() == 0)
			add(new Signature("Default signature"));
		
		notifyDataSetChanged();
	}
	

}
